package com.example.redis.service;

import com.example.redis.dao.RedisDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    private final RedisDao redisDao;

    @Autowired
    public UserService(RedisDao redisDao) {
        this.redisDao = redisDao;
    }

    public void saveUserData(String userId, String userData) {
        redisDao.setKey(userId, userData);
    }

    public String getUserData(String userId) {
        return redisDao.getValue(userId);
    }
}